package com.redijedi.tapestry.internal;

import org.apache.tapestry.ValueEncoder;

/**
 * @author torr
 * 
 */
public class DoubleValueEncoder implements ValueEncoder<Double> {

	public String toClient(Double value) {
		return value == null ? "" : value.toString();
	}

	public Double toValue(String clientValue) {
		try {
			return new Double(clientValue);
		} catch (NumberFormatException e) {
			return null;
		}
	}

}
